home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Aminet 21
/
Aminet 21 (1997)(GTI - Schatztruhe)[!][Oct 1997].iso
/
Aminet
/
util
/
cdity
/
availmem2.lha
/
AvailMem2
/
src
/
AvailMem2_main.s
< prev
next >
Wrap
Text File
|
1997-07-01
|
21KB
|
769 lines
machine 68020
* program includes
include "AvailMem2_gui.i"
include "AvailMem2.i"
include "lvo.i"
incdir "include:"
include "exec/types.i"
include "exec/execbase.i"
include "exec/memory.i"
include "exec/funcdef.i"
include "dos/dos.i"
include "dos/dosextens.i"
include "libraries/commodities.i"
include "workbench/workbench.i"
include "workbench/startup.i"
include "libraries/sysinfo.i"
include "libraries/sysinfo_lib.i"
* program defines
_SysBase equ (4).w ;execbase constant
KICKVER equ 37 ;require OS2.0+
CONFVER equ 1 ;config-version
CX_POPKEY equ 1 ;CX GUI Popup key
section code,code ;availmem code section
prg_Startup
move.l (4).w,a6 ;put execbase in a6
sub.l a1,a1 ;clear a1
jsr _LVOFindTask(a6) ;find this task
move.l d0,ptr_ThisTask ;store taskptr
move.l ptr_ThisTask,a4 ;put pointer to task in a4
tst.l pr_CLI(a4) ;check if started from CLI
bne .StartedFromCLI ;skip if launched from CLI
lea.l pr_MsgPort(a4),a0 ;get ptr to msgport
jsr _LVOWaitPort(a6) ;wait for msg-port
lea.l pr_MsgPort(a4),a0 ;get ptr to msgport
jsr _LVOGetMsg(a6) ;get waiting startup-message
move.l d0,ptr_StartupMsg ;store wbmessage
.StartedFromCLI
move.l (4).w,a6 ;put execbase in a6
move.l ptr_ThisTask,a1 ;put ptr to task in a1
move.l #-30,d0 ;Set low priority
jsr _LVOSetTaskPri(a6) ;set task priority
move.l d0,prg_OldPriority ;store old priority
move.l (4).w,a6 ;put execbase in a6
lea.l _LibraryList,a4 ;get pointer to list of libraries
.OpenLibraries
move.l (a4)+,a1 ;get pointer to lib-string into a1
move.l (a4)+,a3 ;get pointer to libbase-var
move.l a1,d0 ;put string-pointer in d0
tst.l d0 ;check if no libs left
beq .AllLibrariesOpen ;leave loop if so
move.l #KICKVER,d0 ;set kick-version
jsr _LVOOpenLibrary(a6) ;open library
move.l d0,(a3) ;store library base
tst.l d0 ;check if opened ok
beq prg_Fail ;bail out if failure
bra .OpenLibraries ;loop lib-opening
.AllLibrariesOpen
* open not essential libraries
move.l (4).w,a6 ;put execbase in a6
lea.l _IconName,a1 ;get ptr to icon.library
move.l #KICKVER,d0 ;put kick version in d0
jsr _LVOOpenLibrary(a6) ;open icon.library
move.l d0,_IconBase ;store library base
move.l (4).w,a6 ;put execbase in a6
lea.l _SysInfoName,a1 ;get ptr to SysInfo.library
move.l #2,d0 ;put ver 2 version in d0
jsr _LVOOpenLibrary(a6) ;open icon.library
move.l d0,_SysInfoBase ;store library base
move.w AttnFlags(a6),d0 ;get processor-type flags
btst #AFB_68040,d0 ;check if 68040
bne .processor_Ok ;if so, continue startup
btst #AFB_68030,d0 ;check if 68030
bne .processor_Ok ;if so, continue startup
btst #AFB_68020,d0 ;check if 68020
bne .processor_Ok ;if so, continue startup
lea.l _SorryCPUBody,a0 ;get pointer to sorry-text
lea.l _SorryCPUGadgets,a1 ;get pointer to sorry-gadgets
jsr _ProgramRequest ;create a program requester
bra prg_Fail ;bail out, processor is < 020
.processor_Ok
lea.l _DefaultPopup,a0 ;get ptr to default popup key
move.l a0,ptr_PopupKey ;store the hotkey
st.l prg_Popup ;set program popup
lea.l prg_ConfigFile,a0 ;get ptr to default config-name
move.l a0,ptr_ConfigName ;store default config-file name
tst.l ptr_StartupMsg ;check if launched from WB
beq .NoDirWaiting ;skip if launched from CLI
move.l _DosBase,a6 ;put dosbase in a6
move.l ptr_StartupMsg,a2 ;get ptr to wbmessage
move.l sm_ArgList(a2),a2 ;get ptr to wbstartup-message
move.l wa_Lock(a2),d1 ;get currentdir lock
jsr _LVOCurrentDir(a6) ;set current directory
tst.l _IconBase ;check if icon.library opened
beq .NoDirWaiting ;skip iconload if not opened
move.l _IconBase,a6 ;put iconbase in a6
move.l wa_Name(a2),a0 ;put ptr to programname in a0
jsr _LVOGetDiskObjectNew(a6);load the program-icon
move.l d0,ptr_ProgramIcon ;store whatever result
tst.l ptr_ProgramIcon ;check if icon loaded
beq .NoDirWaiting ;skip if icon not loaded
move.l ptr_ProgramIcon,a4 ;put ptr to icon in a4
move.l do_ToolTypes(a4),a0 ;put ptr to icon tooltypes in a0
lea.l ttp_CX_POPKEY,a1 ;get ptr to tooltype into a1
jsr _LVOFindToolType(a6) ;find specific tooltype
tst.l d0 ;check if new key found
beq .no_CX_POPKEY ;skip if not
move.l d0,ptr_PopupKey ;set a different popup key
.no_CX_POPKEY
move.l do_ToolTypes(a4),a0 ;put ptr to icon tooltypes in a0
lea.l ttp_CX_POPUP,a1 ;get ptr to tooltype into a1
jsr _LVOFindToolType(a6) ;find specific tooltype
tst.l d0 ;check if tooltype found
beq .no_CX_POPUP ;skip if not
move.l d0,a0 ;put toolvalue in a0
lea.l bool_YES,a1 ;get ptr to "YES" into a1
jsr _LVOMatchToolValue(a6) ;try to match toolvalue
tst.l d0 ;check if program should popup
sne prg_Popup ;set if it should popup
.no_CX_POPUP
move.l do_ToolTypes(a4),a0 ;put ptr to icon tooltypes in a0
lea.l ttp_CFGNAME,a1 ;get ptr to tooltype into a1
jsr _LVOFindToolType(a6) ;find specific tooltype
tst.l d0 ;check if tooltype found
beq .no_CFGNAME ;skip if not
move.l d0,ptr_ConfigName ;set new config name
.no_CFGNAME
.NoDirWaiting
* setup CX handling
jsr _SetupCX ;add to CX-chain
tst.l d0 ;check if successfull
beq prg_Fail ;bail out if failure
* set win-title ptr to prg wtitle string buffer
lea.l prg_WindowTitle,a1 ;get ptr to win-title buffer
lea.l MemoryDisplayWindowTags,a2;get ptr to mem-display taglist
move.l a1,52(a2) ;set new window-title
* try to load the preferences
jsr _LoadMainPreferences ;load preferences
tst.l d0 ;check if prefs loaded
beq .SetDefaults ;skip if not
jsr _RetrieveSettings ;get settings into action
bra .PrefsLoaded ;skip default settings
.SetDefaults
* set a few default preferences
jsr _ResetToDefaults ;set default settings
jsr _RetrieveSettings ;get settings from config-area
.PrefsLoaded
jsr _StoreSettings ;fill in the config-area
tst.l prg_Popup ;check if program should popup
beq .skip_Popup ;skip if not
jsr _OpenGUI ;open program GUI
tst.l d0 ;check if gui-open succeeded
beq prg_Fail ;bail out if failure
jsr _CalculateBars ;calculate memory-bar positions
.skip_Popup
clr.l prg_Terminate ;reset termination variable
* activate program cx-object
move.l _CommoditiesBase,a6 ;put commoditiesbase in a6
move.l ptr_ProgramBroker,a0 ;put program broker in a0
move.l #TRUE,d0 ;set active to true
jsr _LVOActivateCxObj(a6) ;activate main broker
* initialize sysinfo cpu-server
tst.l _SysInfoBase ;check if SysInfo opened
beq .no_sysinfo ;skip if not
move.l _SysInfoBase,a6 ;SysInfobase in a6
jsr _LVOInitSysInfo(a6) ;initialize sysinfo-structure
move.l d0,ptr_SysInfo ;just store output
beq .no_sysinfo ;skip if failed
move.l (4).w,a6 ;execbase in a6
move.l #SITCU_SIZEOF,d0 ;put size of cpu-usage struct in a6
move.l #MEMF_CLEAR,d1 ;set spec. attributes to memalloc
jsr _LVOAllocVec(a6) ;allocate cpu-usage structure
move.l d0,ptr_CpuUsage ;just store pointer
beq .no_sysinfo
move.l _SysInfoBase,a6 ;put sysinfobase in a6
move.l ptr_SysInfo,a0 ;put ptr to sysinfo-structure in a0
move.l #AN_USE_MESSAGES,d0 ;use messages, not signals
move.l #20,d1 ;allow 20 messages to wait at port
jsr _LVOAddNotify(a6) ;add cpu-notify service
move.l d0,ptr_Notify ;store notify-service
.no_sysinfo
prg_Main ;availmem main program loop
* handle all user interaction and system msgs
jsr _HandleMemoryDisplayMsgs;handle the mem-display win msgs
tst.l d0 ;check if any errors occured
bne prg_Fail ;bail out if so
jsr _HandleSettingsMsgs ;handle the settings win msgs
tst.l d0 ;check if any errors occured
bne prg_Fail ;bail out if so
jsr _HandleResizeMsgs ;handle the resize win msgs
tst.l d0 ;check if any errors occured
bne prg_Fail ;bail out if so
jsr _HandleCxMsgs ;handle the CX-port messages
tst.l d0 ;check if any errors occured
bne prg_Fail ;bail out if so
jsr _HandleSysInfoMsgs ;handle cpu usage port
* check if we are the top window displayed and if not, pop us to front
tst.l prg_AlwaysOnTop ;check if window should depth-reorganize
beq .noReorganize ;skip if not
tst.l MemoryDisplayWnd ;check if mem-window open
beq .noReorganize ;skip if not
tst.l prg_OnTopCounter ;check if counter has counted enough
beq .Reorganize ;jump if so
sub.l #1,prg_OnTopCounter ;decrease counter
bra .noReorganize ;skip reorganize
.Reorganize
move.l prg_VBLDelay,d1 ;put how many vbl's between update
addq.l #1,d1 ;add 1 to avoid div by zero
move.l #150,d0 ;put 150 vbl (3 sec) in d0
divu.l d1,d0 ;divide with update rate
move.l d0,prg_OnTopCounter ;store new counter
move.l MemoryDisplayWnd,a0 ;put ptr to memdisp-window in a0
move.l _IntuitionBase,a6 ;put intuitionbase in a6
move.l MemoryDisplayWnd,a0 ;put mem-display window in a0
jsr _LVOWindowToFront(a6) ;bring window to front
.noReorganize
tst.l prg_Terminate ;check if program should terminate
bne prg_CloseDown ;terminate if true
* render the memorybars
tst.l prg_RenderBarsOk ;check if init of bars succeeded
beq .no_render ;skip if not
tst.l MemoryDisplayWnd ;check if mem-display is open
beq .no_render ;skip if not
jsr _RenderBars ;draw memory-bars
.no_render
* make a small wait
move.l _DosBase,a6 ;put dosbase in a6
move.l prg_VBLDelay,d1 ;wait a few vbls
addq.l #1,d1 ;convert to correct value
jsr _LVODelay(a6) ;go and wait (Zzz...)
bra prg_Main ;loop main
prg_CloseDown
jsr _CloseGUI ;close program GUI
jsr _QuitCX ;remove from CX chain
tst.l _SysInfoBase ;check if SysInfo.library open
beq .no_SysInfobase ;skip if opening failed
move.l _SysInfoBase,a6 ;put SysInfobase in a6
tst.l ptr_SysInfo ;check if library inited ok
beq .no_sysinfo ;skip if not
tst.l ptr_Notify ;check if notify loaded
beq .no_notify ;skip if not
move.l ptr_SysInfo,a0 ;put ptr to sysinfo in a0
move.l ptr_Notify,a1 ;put ptr to notify in a1
jsr _LVORemoveNotify(a6) ;remove notify
move.l #0,ptr_Notify ;clear notify-pointer
.no_notify
move.l ptr_SysInfo,a0 ;put ptr to sysinfo-structure in a0
jsr _LVOFreeSysInfo(a6) ;dealloc sysinfo-structure
move.l #0,ptr_SysInfo ;clear sysinfo-structure ptr
.no_sysinfo
move.l a6,a1 ;put SysInfobase in a1
move.l (4).w,a6 ;put execbase in a6
jsr _LVOCloseLibrary(a6) ;close SysInfo.library
move.l #0,_SysInfoBase ;reset library base
.no_SysInfobase
tst.l _IconBase ;check if icon.library open
beq .no_iconbase ;skip if opening failed
move.l _IconBase,a6 ;put iconbase in a6
tst.l ptr_ProgramIcon ;Check if icon was loaded
beq .no_Icon_loaded ;skip if not
move.l ptr_ProgramIcon,a0 ;put ptr to icon in a0
jsr _LVOFreeDiskObject(a6) ;free the icon
.no_Icon_loaded
move.l a6,a1 ;put iconbase in a1
move.l (4).w,a6 ;put execbase in a6
jsr _LVOCloseLibrary(a6) ;close icon.library
move.l #0,_IconBase ;reset library base
.no_iconbase
move.l (4).w,a6 ;put execbase in a6
lea.l _LibraryList,a4 ;get pointer to libs into a4
.CloseLibraries
move.l (a4)+,d0 ;get pointer to lib-string into a1
move.l (a4)+,a1 ;get pointer to libbase-var
tst.l d0 ;check if no open libs left
beq .AllLibrariesClosed ;leave loop if so
move.l (a1),d1 ;put pointer to lib in d1
move.l #0,(a1) ;reset library base
tst.l d1 ;check if library open
beq .DontCloseLib ;skip if not
move.l d1,a1 ;put pointer to lib in a1
jsr _LVOCloseLibrary(a6) ;close library
.DontCloseLib
bra .CloseLibraries ;loop lib-closening
.AllLibrariesClosed
move.l (4).w,a6 ;put execbase in a6
move.l ptr_ThisTask,a1 ;put ptr to task in a1
move.l prg_OldPriority,d0 ;Set old priority
jsr _LVOSetTaskPri(a6) ;set task priority
tst.l ptr_StartupMsg ;check if message saved
beq .NoWBMessage ;skip if launched from CLI
move.l (4).w,a6 ;put execbase in a6
jsr _LVOForbid(a6) ;Forbid multitasking (No permit needed)
move.l ptr_StartupMsg,a1 ;put wbmessage in a1
jsr _LVOReplyMsg(a6) ;reply wbmessage
.NoWBMessage
move.l prg_Error,d0 ;put exitcode in d0
rts ;exit program
prg_Fail
move.l #20,prg_Error ;set program error
bra prg_CloseDown ;quit program
* subroutines
_HandleSysInfoMsgs
* * * * * * * * * * * * * * * * * * * * *
* *
* Scans the sysinfo-port for messages *
* and if found, updates the contents *
* of the cpu usage bars. *
* *
* * * * * * * * * * * * * * * * * * * * *
movem.l d0-a6,-(sp)
clr.l d7 ;reset check variable
tst.l ptr_Notify ;check if sysinfo opened
beq .no_cpuusage ;skip if not
.GetMsgLoop
move.l (4).w,a6 ;execbase in a6
move.l ptr_Notify,a2 ;ptr to notify struct in a2
move.l SIN_notify_port(a2),a0 ;put notify-port in a0
jsr _LVOGetMsg(a6) ;get awaitning messages
tst.l d0 ;check if any messages received
beq .AllMsgsGotten ;skip if EOM
move.l d0,a1 ;put message in a1
jsr _LVOReplyMsg(a6) ;reply message
st.l d7 ;set update variable
bra .GetMsgLoop ;loop message-retreiving
.AllMsgsGotten
tst.l d7 ;check if messages received
beq .no_cpuusage ;skip if not
move.l _SysInfoBase,a6 ;sysinfobase in a6
move.l ptr_SysInfo,a0 ;put sysinfo struct in a0
move.l ptr_CpuUsage,a1 ;put cpuusage struct in a1
jsr _LVOGetCpuUsage(a6) ;get current cpu-load
move.l ptr_CpuUsage,a0 ;put CPU-usage struct ptr in a0
move.l SICU_used_cputime_lastsec(a0),d0 ;get amount used last second
muls.l #100,d0 ;multiplicate with 100 (to get procent)
divs.l SICU_used_cputime_lastsec_hz(a0),d0 ;div with hz per second
move.l d0,prg_CPUUsage ;store cpu-usage
.no_cpuusage
movem.l (sp)+,d0-a6
rts
_OpenGUI
* * * * * * * * * * * * * * * * * * * * *
* *
* Locks the screen and opens the *
* memory-display window. *
* *
* OUT: d0 - success. (=0 FAIL) *
* *
* * * * * * * * * * * * * * * * * * * * *
movem.l d0-a6,-(sp) ;push all registers
lea.l MemoryDisplayWindowTags,a1;get ptr to window-tags into a1
move.l #WFLG_SMART_REFRESH!WFLG_GIMMEZEROZERO!WFLG_ACTIVATE,d4;set window params
lea.l prg_WindowTitle,a0 ;get ptr to window-title into a0
move.l a0,52(a1) ;set new window-title
tst.l prg_MinimizeBorders ;check if borders should minimize
bne .do_MinimizeBorders ;skip if so
or.l #WFLG_DRAGBAR!WFLG_DEPTHGADGET!WFLG_CLOSEGADGET,d4;add gadgets
bra .BordersOk ;skip win-title resetting
.do_MinimizeBorders
move.l #0,52(a1) ;reset new window-title
.BordersOk
tst.l prg_RemoveBorder ;check if borders should be removed
beq .no_removeborders ;skip if not
or.l #WFLG_BORDERLESS,d4 ;remove borders
.no_removeborders
tst.l prg_GoBackdrop ;check if window should backdrop
beq .no_backdrop ;skip if not
or.l #WFLG_BACKDROP,d4 ;add backdrop flag
.no_backdrop
move.l d4,44(a1) ;set window-flags
lea.l prg_ScreenName,a0 ;get ptr to screen-name
move.l a0,PubScreenName ;set new display-screen
jsr SetupScreen ;initialize screen
tst.l d0 ;check if init worked
beq .OpenedOk ;skip if screen locked
jsr CloseDownScreen ;unlock screen
move.l #0,PubScreenName ;reset screen-name
jsr SetupScreen ;try again
tst.l d0 ;check if init worked
bne .Fail ;bail out if failure
.OpenedOk
move.l Scr,a0 ;get ptr to locked screen into a0
lea.l ResizeWindowTags,a1 ;get ptr to resize-window into a1
move.w sc_Width(a0),d0 ;get screen width into d0
ext.l d0 ;extend to longword
move.l d0,92(a1) ;set resize-width to max
move.w sc_Height(a0),d0 ;get screen height into d0
ext.l d0 ;extend to longword
move.l d0,92+8(a1) ;set resize-height to max
jsr OpenMemoryDisplayWindow ;Open AvailMem main window
tst.l d0 ;check if window opened ok
bne .Fail ;bail out if failure
jsr _CalculateBars ;recalculate bar structures
move.l _IntuitionBase,a6 ;put intutionbase in a6
tst.l prg_RenderBarsOk ;check if bar-calc went ok
beq .no_flushbuttons ;skip if not
tst.l prg_FlushButtons ;check if flushbuttons should be added
beq .no_flushbuttons ;skip if not
jsr _AddFlushGadget ;add flushbuttons
.no_flushbuttons
movem.l (sp)+,d0-a6 ;pop all registers
st.l d0 ;set exitcode to TRUE
rts ;return
.Fail
movem.l (sp)+,d0-a6 ;pop all registers
clr.l d0 ;set exitcode to FALSE
rts ;return
_CloseGUI
* * * * * * * * * * * * * * * * * * * * *
* *
* Closes all program windows and *
* unlocks the screen. *
* *
* * * * * * * * * * * * * * * * * * * * *
movem.l d0-a6,-(sp) ;push all registers
jsr CloseResizeWindow ;close resize window
jsr CloseSettingsWindow ;close settings window
jsr CloseMemoryDisplayWindow;close main window
jsr CloseDownScreen ;deinitalize screen
movem.l (sp)+,d0-a6 ;pop all registers
rts ;return
_ProgramRequest
* * * * * * * * * * * * * * * * * * * * *
* *
* Opens a program requester. *
* *
* IN: *
* a0 - ptr to body. *
* a1 - ptr to gadgets. *
* *
* OUT: d0 - gadget pressed.(=-1 FAIL) *
* *
* * * * * * * * * * * * * * * * * * * * *
movem.l d1-a6,-(sp) ;push registers
move.l a0,a3 ;put title-text in a3
move.l a1,a4 ;put body-text in a4
move.l (4).w,a6 ;put execbase in a6
move.l #EasyStruct_SIZEOF,d0 ;put size of EasyRequest in d0
move.l #MEMF_CLEAR,d1 ;put memory flag CLEAR in d1
jsr _LVOAllocVec(a6) ;Alloc a EasyRequest
move.l d0,a2 ;store EasyRequest
beq .Fail ;bail our if failure
move.l _IntuitionBase,a6 ;put intuitionbase in a6
move.l #EasyStruct_SIZEOF,es_StructSize(a2)
;put size in es_StructSize
lea.l _RequesterTitle,a0 ;get ptr to requester title text
move.l a0,es_Title(a2) ;put title in es_Title
move.l a3,es_TextFormat(a2) ;put body in es_TextFormat
move.l a4,es_GadgetFormat(a2) ;put gadgets in es_GadgetFormat
move.l a2,a5 ;put EasyRequest in a5
move.l MemoryDisplayWnd,a0 ;put mem-display window in a0
move.l a5,a1 ;put EasyRequest in a1
sub.l a2,a2 ;clear IDCMP-flags
sub.l a3,a3 ;clear ArgList
move.l a2,a0 ;put EasyRequest in a0
jsr _LVOEasyRequestArgs(a6) ;produce a EasyRequest
move.l d0,d7 ;store answer in d7
move.l (4).w,a6 ;put execbase in a6
move.l a5,a1 ;put EasyRequest in a1
jsr _LVOFreeVec(a6) ;Free EasyRequest
move.l d7,d0 ;put gadgetpressed in d0
movem.l (sp)+,d1-a6 ;pop registers
rts ;return
.Fail
movem.l (sp)+,d1-a6 ;pop registers
moveq.l #-1,d0 ;return ERROR (No IDCMPFlag occur.)
rts ;return
_StringCopy
* * * * * * * * * * * * * * * * * * * * *
* *
* Copies a null-terminated string. *
* *
* IN: a0 - source string. *
* a1 - dest string. *
* *
* OUT: d0 - ptr to end of dest string. *
* *
* * * * * * * * * * * * * * * * * * * * *
movem.l d1-a6,-(sp) ;push all registers
.CopyLoop
move.b (a0)+,d0 ;read input char
move.b d0,(a1)+ ;write output char
tst.b d0 ;check if EOS
bne .CopyLoop ;loop if not
move.l a1,d0 ;put ptr to end of dest string in d0
movem.l (sp)+,d1-a6 ;pop all registers
rts ;return
section data,data ;availmem data section
_LibraryList
dc.l _DosName,_DosBase
dc.l _GfxName,_GfxBase
dc.l _IntuitionName,_IntuitionBase
dc.l _GadToolsName,_GadToolsBase
dc.l _CommoditiesName,_CommoditiesBase
dc.l 0 ;end of list
* library names
_DosName dc.b "dos.library",0
_GfxName dc.b "graphics.library",0
_IntuitionName dc.b "intuition.library",0
_GadToolsName dc.b "gadtools.library",0
_CommoditiesName dc.b "commodities.library",0
_IconName dc.b "icon.library",0
_SysInfoName dc.b "SysInfo.library",0
* requester strings
_RequesterTitle dc.b "AvailMem Request",0
* Tooltype strings
ttp_CX_POPUP dc.b "CX_POPUP",0
ttp_CX_POPKEY dc.b "CX_POPKEY",0
ttp_CX_PRIORITY dc.b "CX_PRIORITY",0
ttp_CONFIG dc.b "CONFIG",0
ttp_CFGNAME dc.b "CFGNAME",0
* default config name
prg_ConfigFile dc.b "AvailMem",0
prg_ConfigAttach dc.b ".config",0
* boolean true variables
bool_YES dc.b "YES",0
* requester text
_SorryCPUBody dc.b "Sorry, this program\n"
dc.b " requires at least\n"
dc.b " a MC68020",0
_SorryCPUGadgets dc.b "Ok",0
section bss,bss ;availmem bss section
* library bases
_DosBase ds.l 1
_GfxBase ds.l 1
_IntuitionBase ds.l 1
_GadToolsBase ds.l 1
_CommoditiesBase ds.l 1
_IconBase ds.l 1
_SysInfoBase ds.l 1
* program variables
ptr_ThisTask ds.l 1 ;ptr to Task structure
ptr_StartupMsg ds.l 1 ;ptr to WBStartup message
ptr_TempMsg ds.l 1 ;ptr to any message
ptr_SysInfo ds.l 1 ;ptr to sysinfo structure
ptr_CpuUsage ds.l 1 ;ptr to cpuusage structure
ptr_Notify ds.l 1 ;ptr to notify structure
ptr_ProgramIcon ds.l 1 ;ptr to program icon
ptr_ConfigName ds.l 1 ;ptr to config-file name
prg_Error ds.l 1 ;program exitcode
prg_Terminate ds.l 1 ;program terminate variable
prg_OldPriority ds.l 1 ;program old priority
prg_OnTopCounter ds.l 1 ;counter that controls 'on top' feature